<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class LoginRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'username'=>'required',
            'pass'=>'required',
            'captcha'=>'required|captcha',
        ];
    }

    public function messages()
    {
        return [
            'required'=>':attribute不能为空',
            'captcha'=>':attribute错误',
        ];
    }

    public function attributes()
    {
        return [
            'username'=>'登录账号',
            'pass'=>'登录密码',
            'captcha'=>'验证码',
        ];
    }
}
